/**
 * Sample React Native App By Wyh
 * Created by wyh on 15/12/23.
 */
'use strict';

import {
  AsyncStorage
} from 'react-native';

import {
  Store,
  msg,
} from 'iflux-native';


/**
 * 数据中心
 */
var appStore = module.exports = Store({
  isOpen: false,
  name2: '',
});


msg
  .on('home:isOpenChange', isOpenChange)
  .on('home:usernameChange', name2Change);


/**
 * isOpen改变
 * @param isOpen
 */
function isOpenChange(isOpen) {
  console.log('isOpen111='+isOpen);
  appStore.cursor().set('isOpen', !isOpen);
  console.log('isOpen2222='+appStore.data().get('isOpen'));
}


/**
 * 密码输入改变
 * @param password
 */
function name2Change(name2) {
  appStore.cursor().set('name2', name2);
}

